package com.bs.elasticsearch.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.elasticsearch.common.geo.GeoPoint;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.GeoPointField;

/**
 * @author bingshao
 * @date 2023/4/4
 **/
@Data
@Document(indexName = "location", createIndex = false)
public class LocationVo {

    @Id
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String name;

//    @Field(type = FieldType.Double)
//    private Double longitude;
//
//    @Field(type = FieldType.Double)
//    private Double latitude;

    @GeoPointField
    private GeoPoint geoPoint;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String address;

    @Field(type = FieldType.Keyword)
    private String phone;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String catalog;

    @Field(type = FieldType.Keyword)
    private String provinceId;

    @Field(type = FieldType.Keyword)
    private String cityId;

    @Field(type = FieldType.Keyword)
    private String countyId;

    @Field(type = FieldType.Keyword)
    private String streetId;

}

